home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / Telephones.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  48KB  |  1,045 lines

  1. /*
  2.      File:        Telephones.h
  3.  
  4.      Contains:    Telephone Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __TELEPHONES__
  19. #define __TELEPHONES__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __WINDOWS__
  25. #include <Windows.h>
  26. #endif
  27. #ifndef __DIALOGS__
  28. #include <Dialogs.h>
  29. #endif
  30. #ifndef __ERRORS__
  31. #include <Errors.h>
  32. #endif
  33. #ifndef __EVENTS__
  34. #include <Events.h>
  35. #endif
  36. #ifndef __CTBUTILITIES__
  37. #include <CTBUtilities.h>
  38. #endif
  39. #ifndef __COMPONENTS__
  40. #include <Components.h>
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT_SUPPORTED
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_ALIGN_SUPPORTED
  52. #pragma options align=mac68k
  53. #endif
  54.  
  55. #if FOR_SYSTEM7_ONLY
  56.  
  57. enum {
  58.     curTELVersion                = 3,                            /* current Telephone Manager version */
  59.                                                                 /*    the chooseXXX symbols are defined in CTBUtilities.(pah) */
  60.     telChooseDisaster            = chooseDisaster,
  61.     telChooseFailed                = chooseFailed,
  62.     telChooseAborted            = chooseAborted,
  63.     telChooseOKMinor            = chooseOKMinor,
  64.     telChooseOKMajor            = chooseOKMajor,
  65.     telChooseCancel                = chooseCancel,
  66.     telChooseOKTermChanged        = 4
  67. };
  68.  
  69. #endif
  70. #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
  71. #ifndef classTEL
  72.  
  73. enum {
  74.                                                                 /* telephone tool file type */
  75.     classTEL                    = 'vbnd'
  76. };
  77.  
  78. #endif
  79.  
  80. enum {
  81.                                                                 /* PHYSICAL TERMINAL CONSTANTS */
  82.                                                                 /* INDEPENDENT HANDSET CONSTANTS */
  83.     telIndHSOnHook                = 0,                            /* independent handset on hook */
  84.     telIndHSOffHook                = 1,                            /* independent handset off hook */
  85.     telIndHSDisconnected        = 0,                            /* handset disconnected from the line */
  86.     telIndHSConnected            = 1,                            /* handset connected to the line */
  87.                                                                 /* HOOK STATE CONSTANTS */
  88.     telHandset                    = 1,                            /* handset hookswitch */
  89.     telSpeakerphone                = 2,                            /* speakerphone 'on' switch */
  90.     telDeviceOffHook            = 1,                            /* device off hook */
  91.     telDeviceOnHook                = 0,                            /* device on hook */
  92.                                                                 /* VOLUME CONTROL CONSTANTS */
  93.     telHandsetSpeakerVol        = 1,                            /* volume of the handset speaker */
  94.     telHandsetMicVol            = 2,                            /* sensitivity of the handset mic */
  95.     telSpeakerphoneVol            = 3,                            /* speakerphone volume */
  96.     telSpeakerphoneMicVol        = 4,                            /* sensitivity of the spkrphone mic */
  97.     telRingerVol                = 5,                            /* volume of the ringer */
  98.     telBuiltinSPVol                = 6,                            /* volume of the built-in speakerphone */
  99.     telBuiltinSPMicVol            = 7,                            /* sensitivity of the built-in speakerphone mic */
  100.     telVolSame                    = 0,                            /* leaves the volume at previous level */
  101.     telVolMin                    = 1,                            /* turns volume down to minimum level, but not off */
  102.     telVolMax                    = 100,                            /* highest level allowed by the Telephone Manager */
  103.     telVolStateSame                = 0,                            /* leaves device in same state */
  104.     telVolStateOff                = 1,                            /* turns the device off , */
  105.                                                                 /* but doesn't change the volume setting. */
  106.                                                                 /* Use for mute functions. */
  107.     telVolStateOn                = 2,                            /* turns the device on.  Volume setting is */
  108.                                                                 /* the same as previously set.*/
  109.                                                                 /* DISPLAY CONSTANTS */
  110.     telNormalDisplayMode        = 1,                            /* normal display mode */
  111.     telInspectMode                = 2,                            /* inspect display mode */
  112.     telMiscMode                    = 3,                            /* miscellaneous display mode */
  113.     telRetrieveMode                = 4,                            /* message retrieval mode */
  114.     telDirectoryQueryMode        = 5,                            /* electronic directory mode */
  115.     telEntireDisplay            = 0,                            /* entire Display */
  116.                                                                 /* KEY PRESS CONSTANTS */
  117.     telHangupKey                = 1,                            /* drop, or release, key pressed */
  118.     telHoldKey                    = 2,                            /* hold key pressed */
  119.     telConferenceKey            = 3,                            /* conference key pressed */
  120.     telTransferKey                = 4,                            /* transfer key pressed */
  121.     telForwardKey                = 5,                            /* call forward key pressed */
  122.     telCallbackKey                = 6,                            /* call back key pressed */
  123.     telDNDKey                    = 7,                            /* do not disturb key pressed */
  124.     telCallPickupKey            = 8,                            /* call Pickup key pressed */
  125.     telCallParkKey                = 9,                            /* call Park key pressed */
  126.     telCallDeflectKey            = 10,                            /* call Deflect key pressed */
  127.     telVoiceMailAccessKey        = 11,                            /* voice Mail Access key pressed */
  128.     telCallRejectKey            = 12,                            /* call Reject key pressed */
  129.     telOtherKey                    = 16,                            /* other key pressed */
  130.     telKeyPadPress                = 1,                            /* key pressed on 12 digit keypad*/
  131.     telFeatureKeyPress            = 2,                            /* feature Key Pressed */
  132.     telTerminalEnabled            = 0,
  133.     telTerminalDisabled            = 1,
  134.     telUnknown                    = 0,                            /* unknown error */
  135.     telTerminalHWDisconnected    = 1,                            /* terminal hardware is disconnected */
  136.     telDeviceDriverClosed        = 2,                            /* device driver is closed */
  137.                                                                 /* ALERT PATTERN */
  138.     telPattern0                    = 0,
  139.     telPattern1                    = 1,
  140.     telPattern2                    = 2,
  141.     telPattern3                    = 3,
  142.     telPattern4                    = 4,
  143.     telPattern5                    = 5,
  144.     telPattern6                    = 6,
  145.     telPattern7                    = 7,
  146.     telPatternOff                = 8,
  147.     telPatternUndefined            = 15,                            /* DN TYPES */
  148.     telAllDNs                    = 0,                            /* counts all types of DNs */
  149.     telInternalDNs                = 1,                            /* connected to PBX or other non-public switch */
  150.     telInternalDNsOnly            = 2,                            /* connected to PBX or other non-public switch */
  151.                                                                 /* and able to place internal calls only */
  152.     telExternalDNs                = 3,                            /* connected to public network */
  153.     telDNTypeUnknown            = 4,                            /* DN type unknown */
  154.                                                                 /* DN USAGE */
  155.     telDNNotUsed                = 0,                            /* DN is not used - onhook */
  156.     telDNPOTSCall                = 1,                            /* DN used for POTs call */
  157.     telDNFaxCall                = 2,                            /* DN used for fax call */
  158.     telDNDataCall                = 3,                            /* DN used for data call */
  159.     telDNAlerting                = 4,                            /* Incoming call at DN */
  160.     telDNUnknownState            = 5,                            /* DN is in unknown state */
  161.                                                                 /* CALL FORWARDING TYPES */
  162.     telForwardImmediate            = 1,                            /* immediately forward calls */
  163.     telForwardBusy                = 2,                            /* forward on Busy */
  164.     telForwardNoAnswer            = 3,                            /* forward on No answer */
  165.     telForwardBusyNA            = 4,                            /* forwarding for busy and no answer*/
  166.     telForwardTypeUnknown        = 5,                            /* type of forwarding is unknown */
  167.                                                                 /* CALL FORWARDING MESSAGES */
  168.     telForwardCleared            = 0,                            /* forwarding has been cleared */
  169.     telForwardEst                = 1,                            /* forwarding has been established*/
  170.     telForwardFailed            = 2,                            /* attempt to setup forwarding has failed*/
  171.                                                                 /* DO NOT DISTURB TYPES */
  172.     telDNDIntExt                = 0,                            /* do not disturb for all internal and external calls*/
  173.     telDNDExternal                = 1,                            /* do not disturb for external calls only */
  174.     telDNDInternal                = 2,                            /* do not disturb for internal calls only */
  175.     telDNDNonIntercom            = 3,                            /* do not disturb for all calls except intercom */
  176.                                                                 /* DO NOT DISTURB MESSAGES */
  177.     telDNDCleared                = 0,                            /* do not disturb has been cleared */
  178.     telDNDEst                    = 1,                            /* do not disturb has been established */
  179.     telDNDFailed                = 2,                            /* attempt to setup do not disturb has failed */
  180.                                                                 /* VOICE MAIL MESSAGES */
  181.     telAllVoiceMessagesRead        = 0,                            /* all messages have been read, none are  waiting */
  182.                                                                 /* to be read */
  183.     telNewVoiceMessage            = 1,                            /* a new message has arrived or messages are waiting */
  184.                                                                 /* for this DN */
  185.                                                                 /* DNSELECT MESSAGE */
  186.     telDNDeselected                = 0,                            /* DN has been deselected */
  187.     telDNSelected                = 1,                            /* DN has been selected */
  188.                                                                 /* CALL ORIGINATORS */
  189.     telInternalCall                = 0,                            /* return nth internal CA */
  190.     telExternalCall                = 1,                            /* return nth external CA */
  191.     telUnknownCallOrigin        = 2,                            /* unknown call type */
  192.     telAllCallOrigins            = 2,                            /* return nth CA internal or external */
  193.                                                                 /* CALL TYPES */
  194.     telVoiceMailAccessOut        = (-7),
  195.     telPageOut                    = (-6),
  196.     telIntercomOut                = (-5),
  197.     telCallbackOut                = (-4),
  198.     telPickup                    = (-3),
  199.     telParkRetrieve                = (-2),
  200.     telNormalOut                = (-1),
  201.     telUnknownCallType            = 0,
  202.     telNormalIn                    = 1,
  203.     telForwardedImmediate        = 2,
  204.     telForwardedBusy            = 3,
  205.     telForwardedNoAnswer        = 4,
  206.     telTransfer                    = 5,
  207.     telDeflected                = 6,
  208.     telIntercepted                = 7,
  209.     telDeflectRecall            = 8,
  210.     telParkRecall                = 9,
  211.     telTransferredRecall        = 10,
  212.     telIntercomIn                = 11,
  213.     telCallbackIn                = 12,                            /* DIAL TYPES */
  214.     telDNDialable                = 0,                            /* this DN could be dialed via TELSetupCall */
  215.     telDNNorthAmerican            = 1,                            /* rmtDN is standard North America 10 digit number */
  216.     telDNInternational            = 2,                            /* rmtDN is an international number */
  217.     telDNAlmostDialable            = 3,                            /* rmtDN is almost dialable, */
  218.                                                                 /* missing prefix such as 9 or 1 */
  219.     telDNUnknown                = 15,                            /* unknown whether DN is dialable */
  220.                                                                 /* CALL PROGRESS MESSAGES */
  221.     telCAPDialTone                = 1,                            /* dial tone */
  222.     telCAPRinging                = 2,                            /* destination CA is alerting */
  223.     telCAPDialing                = 3,                            /* dialing the other end */
  224.     telCAPReorder                = 4,                            /* reorder */
  225.     telCAPBusy                    = 5,                            /* busy */
  226.     telCAPRouted                = 6,                            /* call routed; rmtDN will hold the routing directory */
  227.                                                                 /* number routeDN and routePartyName have been updated */
  228.     telCAPRoutedOff                = 7,                            /* call routed off-network; no further progress will */
  229.                                                                 /* be available */
  230.     telCAPTimeout                = 8,                            /* call timed out */
  231.     telCAPUpdate                = 9,                            /* name and rmtDN information has been updated */
  232.     telCAPPrompt                = 10,                            /* the network is prompting for more information */
  233.     telCAPWaiting                = 11,                            /* call is proceeding, but there is no response yet */
  234.                                                                 /* from the destination */
  235.     telCAPCPC                    = 12,                            /* telephone tool detected CPC signal */
  236.     telCAPNoDialTone            = 13,                            /* dial tone not detected */
  237.     telCAPUnknown                = 15,                            /* call progress state unknown */
  238.     telCAPDialDisabled            = 16,                            /* Blacklisting: Dial Disabled */
  239.     telCAPBlacklistedNumber        = 17,                            /* Blacklisting: Blacklisted Number */
  240.     telCAPForbiddenNumber        = 18,                            /* Blacklisting: Forbidden Number */
  241.     telCAPModemGuardTime        = 19,                            /* Modem Guard Timein force, unable to dial */
  242.     telCAPLCDetected            = 20,                            /* trying to dial a number while the handset is offhook */
  243.     telCAPLostLC                = 21,                            /* trying manual dial or answer while handset not off hook */
  244.                                                                 /* or also lost line current during dialing. */
  245.                                                                 /* OUTGOING CALL MESSAGES */
  246.     telPhysical                    = 0,                            /* user lifted handset and initiated call */
  247.     telProgrammatic                = 1,                            /* programmatic initiation of outgoing call */
  248.                                                                 /* DISCONNECT MESSAGES */
  249.     telLocalDisconnect            = 0,                            /* local party, this user, responsible for disconnect */
  250.     telRemoteDisconnect            = 1,                            /* remote party responsible for disconnect */
  251.                                                                 /* DISCONNECT TYPES */
  252.     telCADNormal                = 1,                            /* normal disconnect */
  253.     telCADBusy                    = 2,                            /* remote user busy */
  254.     telCADNoResponse            = 3,                            /* remote not responding */
  255.     telCADRejected                = 4,                            /* call rejected */
  256.     telCADNumberChanged            = 5,                            /* number changed */
  257.     telCADInvalidDest            = 6,                            /* invalid destination address */
  258.     telCADFacilityRejected        = 7,                            /* requested facility rejected */
  259.     telCADUnobtainableDest        = 9,                            /* destination not obtainable */
  260.     telCADCongested                = 10,                            /* network congestion */
  261.     telCADIncompatibleDest        = 11,                            /* incompatible destination */
  262.     telCADTimeout                = 12,                            /* call timed out */
  263.     telCADUnknown                = 15,                            /* reason unknown */
  264.                                                                 /* CONFERENCE MESSAGES */
  265.     telConferencePrepFailed        = 0,                            /* conference could not be prepared */
  266.     telConferencePending        = 1,                            /* conference prepared successfully */
  267.     telConferenceEstFailed        = 2,                            /* conference could not be established */
  268.     telConferenceEst            = 3,                            /* conference established */
  269.                                                                 /* TRANSFER MESSAGES */
  270.     telTransferPrepFailed        = 0,                            /* transfer could not be prepared */
  271.     telTransferPending            = 1,                            /* transfer prepared successfully */
  272.     telTransferEst                = 2,                            /* consult or blind xfer successful */
  273.     telTransferFailed            = 3,                            /* consult or blind xfer failed */
  274.     telTransferred                = 4,                            /* message to originator of CA specifying */
  275.                                                                 /* that call was transferred to rmtDN */
  276.                                                                 /* HOLD MESSAGES */
  277.     telHoldCleared                = 0,
  278.     telHoldEst                    = 1,
  279.     telHoldFailed                = 2,                            /* RECEIVE DIGIT MESSAGES */
  280.     telDigitAudible                = 0,
  281.     telDigitNotAudible            = 1,                            /* CALL PARK MESSAGES */
  282.     telCallParkEst                = 1,                            /* call has been successfully parked */
  283.     telCallParkRetrieveEst        = 2,                            /* parked Call has been successfully retrieved */
  284.     telCallParkFailed            = 3,                            /* attempt to setup call park has failed */
  285.     telCallParkRetrieveFailed    = 4,                            /* attempt to retrieve parked call failed */
  286.     telCallParkRecall            = 5,                            /* call park has been recalled */
  287.                                                                 /* CALL BACK MESSAGES */
  288.     telCallbackCleared            = 0,                            /* call back has been cleared */
  289.     telCallbackEst                = 1,                            /* call back has been established */
  290.     telCallbackNowAvail            = 2,                            /* call can be called back with TELCallBackNow */
  291.                                                                 /* if CA is zero, else call IS calling back on CA */
  292.     telCallbackFailed            = 3,                            /* attempt to setup callback has failed */
  293.     telCallbackDesired            = 4,                            /* a user has called this terminal, received no */
  294.                                                                 /* answer and desires this terminal to call it */
  295.                                                                 /* back */
  296.     telCallbackDesiredCleared    = 5,                            /* call back for no answer no longer desired */
  297.     telCalledback                = 6,                            /* callback has occurred successfully */
  298.                                                                 /* CALL REJECT MESSAGES */
  299.     telCallRejectFailed            = 0,                            /* attempt to reject call has failed */
  300.     telCallRejectEst            = 1,                            /* call successfully rejected */
  301.     telCallRejected                = 2,                            /* message to originator that call was rejected */
  302.                                                                 /* CALL DEFLECT MESSAGES */
  303.     telCallDeflectFailed        = 0,                            /* attempt to deflect call has failed */
  304.     telCallDeflectEst            = 1,                            /* call successfully deflected */
  305.     telCallDeflectRecall        = 2,                            /* deflected call has been recalled */
  306.     telCallDeflected            = 3,                            /* message to originator that call was deflected */
  307.                                                                 /* to rmtDN */
  308.     telAutoDeflectImmediate        = 4,                            /* a call was automatically deflected from this */
  309.                                                                 /* terminal as a result of immediate call */
  310.                                                                 /* forwarding */
  311.     telAutoDeflectBusy            = 5,                            /* a call was automatically deflected from this */
  312.                                                                 /* terminal as a result of call forwarding on busy */
  313.     telAutoDeflectNoAnswer        = 6,                            /* a call was automatically deflected from this */
  314.                                                                 /* terminal as a result of call forwarding on */
  315.                                                                 /* no answer */
  316.                                                                 /* CONFERENCE SPLIT MESSAGES */
  317.     telConferenceSplitFailed    = 0,                            /* CA could not be split */
  318.     telConferenceSplitEst        = 1,                            /* CA split successfully */
  319.                                                                 /* CONFERENCE DROP MESSAGES */
  320.     telConferenceDropFailed        = 0,                            /* CA could not be dropped */
  321.     telConferenceDropped        = 1,                            /* CA dropped successfully */
  322.                                                                 /* CALL PICKUP MESSAGES */
  323.     telCallPickupEst            = 0,                            /* call pickup was successful */
  324.     telCallPickupFailed            = 1,                            /* call pickup failed */
  325.     telCallPickedUp                = 2,                            /* message to originator that call was picked */
  326.                                                                 /* up at a different DN */
  327.                                                                 /* PAGING MESSAGES */
  328.     telPageEst                    = 0,                            /* paging was successful */
  329.     telPageComplete                = 1,                            /* paging activity completed */
  330.     telPageFailed                = 2,                            /* paging failed */
  331.                                                                 /* INTERCOM MESSAGES */
  332.     telIntercomEst                = 0,                            /* intercom was successful */
  333.     telIntercomComplete            = 1,                            /* intercom activity completed */
  334.     telIntercomFailed            = 2,                            /* intercom failed */
  335.                                                                 /* MODEM TONE MESSAGES */
  336.     telModemToneDetected        = 0,                            /* modem tone was detected */
  337.     telModemToneCleared            = 1,                            /* modem tone went away */
  338.                                                                 /* FAX TONE MESSAGES */
  339.     telFaxToneDetected            = 0,                            /* fax tone was detected */
  340.     telFaxToneCleared            = 1,                            /* fax tone went away */
  341.                                                                 /* IN USE MESSAGES */
  342.     telInUsePrivate                = 0,                            /* MADN is in use and can't be accessed */
  343.     telInUseCanAccess            = 1,                            /* MADN is in use, and others can access it */
  344.                                                                 /* and join in */
  345.     telInUseCanMakePrivate        = 2,                            /* MADN is in use, but available for any one */
  346.                                                                 /* person to access */
  347.     telInUseCleared                = 3,                            /* MADN is no longer in use */
  348.                                                                 /* CALL APPEARANCE STATES */
  349.     telCAIdleState                = 0,                            /* a call doesn't exist at this time */
  350.     telCAInUseState                = 1,                            /* the call is active but at another terminal */
  351.     telCAOfferState                = 2,                            /* a call is being offered to the terminal */
  352.     telCAQueuedState            = 3,                            /* a call is being queued at this terminal */
  353.     telCAAlertingState            = 4,                            /* a call is alerting at the terminal */
  354.     telCADialToneState            = 5,                            /* initiated outgoing call has dialtone */
  355.     telCADialingState            = 6,                            /* initiated outgoing call is dialing */
  356.     telCAWaitingState            = 7,                            /* initiated outgoing call is waiting for */
  357.                                                                 /* response from destination */
  358.     telCARingingState            = 8,                            /* the outgoing call is ringing. */
  359.     telCABusyState                = 9,                            /* destination is busy or can't be reached */
  360.     telCAHeldState                = 10,                            /* call has been put on hold by this terminal */
  361.     telCAConferencedState        = 11,                            /* this CA is part of a conference now */
  362.     telCAActiveState            = 12,                            /* the call is active and parties are free */
  363.                                                                 /* to exchange data */
  364.     telCAReorderState            = 13,                            /* CA is in a reorder state */
  365.     telCAConferencedHeldState    = 14,                            /* CA is a conference call in a held state */
  366.     telCAUnknownState            = 15,                            /* the call state is unknown */
  367.                                                                 /* TERMINAL MESSAGE EVENTMASKS */
  368.     telTermHookMsg                = 0x00000001,                    /* the hookswitch state has changed */
  369.     telTermKeyMsg                = 0x00000002,                    /* a phone pad key has been depressed */
  370.     telTermVolMsg                = 0x00000004,                    /* volume setting has changed */
  371.     telTermDisplayMsg            = 0x00000008,                    /* display has changed */
  372.     telTermEnableMsg            = 0x00000010,                    /* terminal has become enabled */
  373.     telTermOpenMsg                = 0x00000020,                    /* terminal has been opened */
  374.     telTermCloseMsg                = 0x00000040,                    /* terminal is shutting down */
  375.     telTermResetMsg                = 0x00000080,                    /* terminal has been reset */
  376.     telTermErrorMsg                = 0x00000100,                    /* hard equipment error */
  377.     telTermIndHSStateChgMsg        = 0x00000200,                    /* change in handset state from inacive to */
  378.                                                                 /* active or vice versa */
  379.     telTermIndHSConnectMsg        = 0x00000400,                    /* independent handset connection has been changed */
  380.     telTermKeyImmMsg            = 0x00000800,                    /* immidiate arrival of phone pad key */
  381.     telTermVolStateMsg            = 0x00001000,                    /* volume state has changed */
  382.     telTermOtherMsg                = 0x80000000,                    /* vendor defined error */
  383.     telAllTermMsgs                = 0x00001FFF,                    /* mask to all non tool specific terminal events */
  384.                                                                 /* DN MESSAGE EVENTMASK CONSTANTS */
  385.     telDNForwardMsg                = 0x00000001,                    /* forward feature activity */
  386.     telDNDNDMsg                    = 0x00000002,                    /* do not disturb feature activity */
  387.     telDNVoiceMailMsg            = 0x00000004,                    /* message has arrived for this DN */
  388.     telDNSelectedMsg            = 0x00000008,                    /* DN has been selected or deselected */
  389.     telDNOtherMsg                = 0x80000000,                    /* a custom message for use by tools */
  390.     telAllDNMsgs                = 0x0000000F,                    /* mask to all non tool specific dn events */
  391.                                                                 /* CA MESSAGE EVENTMASK CONSTANTS */
  392.     telCAAlertingMsg            = 0x00000001,                    /* CA is alerting  */
  393.     telCAOfferMsg                = 0x00000002,                    /* CA is being offered a call */
  394.     telCAProgressMsg            = 0x00000004,                    /* call progress info for this CA */
  395.     telCAOutgoingMsg            = 0x00000008,                    /* CA is initiating an outgoing call */
  396.     telCADisconnectMsg            = 0x00000010,                    /* CA disconnected (dropped or rmt disc */
  397.     telCAActiveMsg                = 0x00000020,                    /* CA is active and voice/data is free */
  398.                                                                 /* to flow end to end */
  399.     telCAConferenceMsg            = 0x00000040,                    /* conference activity on CA */
  400.     telCATransferMsg            = 0x00000080,                    /* transfer feature activity */
  401.     telCAHoldMsg                = 0x00000100,                    /* hold feature activity */
  402.     telCADigitsMsg                = 0x00000200,                    /* remote signaling digits arrived */
  403.     telCACallParkMsg            = 0x00000400,                    /* CA call park feature activity */
  404.     telCACallbackMsg            = 0x00000800,                    /* CA call back feature activity  */
  405.     telCARejectMsg                = 0x00001000,                    /* CA is rejected */
  406.     telCADeflectMsg                = 0x00002000,                    /* CA is deflected */
  407.     telCAForwardMsg                = 0x00004000,                    /* CA is forwarded to this DN  */
  408.     telCAConferenceSplitMsg        = 0x00008000,                    /* conference split activity  */
  409.     telCAConferenceDropMsg        = 0x00010000,                    /* conference drop activity  */
  410.     telCAQueuedMsg                = 0x00020000,                    /* CA has been queued  */
  411.     telCAInUseMsg                = 0x00040000,                    /* CA is in use  */
  412.     telCACallPickupMsg            = 0x00080000,                    /* CA pickup activity */
  413.     telCAPagingMsg                = 0x00100000,                    /* CA paging activity */
  414.     telCAIntercomMsg            = 0x00200000,                    /* CA intercom activity */
  415.     telCAModemToneMsg            = 0x00400000,                    /* modem tones detected */
  416.     telCAFaxToneMsg                = 0x00800000,                    /* fax tones detected */
  417.     telCAIdleMsg                = 0x01000000,                    /* CA is in idle state */
  418.     telCASuccessiveAlertMsg        = 0x02000000,                    /* phone is alerting, one per ring */
  419.     telCAUserUserInfoMsg        = 0x04000000,                    /* user to user information has arrrived */
  420.                                                                 /* for this CA */
  421.     telCAHandOffMsg                = 0x08000000,                    /* CA is ready for hand-off */
  422.     telCAVoiceDetectedMsg        = 0x10000000,                    /* voice Detect related event */
  423.     telCASilenceDetectedMsg        = 0x20000000,                    /* silence Detect related event */
  424.     telCADigitsImmMsg            = 0x40000000,                    /* immidiate arrival of remote signaling digits */
  425.     telCAOtherMsg                = 0x80000000,                    /* tool specific CA message */
  426.     telAllCAMsgs                = 0x7FFFFFFF                    /* mask to all non tool specific CA events */
  427. };
  428.  
  429. typedef OSErr TELErr;
  430. typedef unsigned long TELFlags;
  431.  
  432. enum {
  433.     telNoMenus                    = 1L << 16,                        /* tells tool not to display any custom menus */
  434.     telQuiet                    = 1L << 17,                        /* tells tool not to display any dialog boxes or alerts */
  435.     telConfigChanged            = 1L << 18                        /* notifies application that the config has changed */
  436. };
  437.  
  438. typedef unsigned long TELFeatureFlags;
  439.  
  440. enum {
  441.     pcmAvail                    = 1L << 0,                        /* true if PCM voice data accessible */
  442.     hasHandset                    = 1L << 1,                        /* true if a phone handset is attached  */
  443.     hasSpeakerphone                = 1L << 2,                        /* true if a 2 way speakerphone is attached */
  444.     canOnHookDial                = 1L << 3,                        /* can on-hook dial */
  445.     hasRinger                    = 1L << 4,                        /* terminal has its own ringer */
  446.     canSetDisplay                = 1L << 5,                        /* application can write to the display */
  447.     hasKeypad                    = 1L << 6,                        /* attached phone has standard 12 key pad */
  448.     hasVideo                    = 1L << 7,                        /* terminal has a videophone */
  449.     hasOther                    = 1L << 8,                        /* reserved for future use */
  450.     crossDNConference            = 1L << 9,                        /* can perform cross-DN conferences */
  451.     hasSubaddress                = 1L << 10,                        /* attached network supports subaddressing */
  452.     hasUserUserInfo                = 1L << 11,                        /* network supports user-to-user info */
  453.     hasHandsetSoundStreams        = 1L << 12,                        /* sound streams are supported on the handset */
  454.     hasIndHandset                = 1L << 13,                        /* handset can be accessed independently of the phone line */
  455.     hasBuiltinSpeakerphone        = 1L << 14                        /* speaker and microphone of the Mac can be used */
  456. };
  457.  
  458. struct TELTermRecord {
  459.  
  460.     short                             tRef;
  461.     TELFeatureFlags                 featureFlags;
  462.     short                             handsetSpeakerVol;
  463.     short                             handsetMicVol;
  464.     short                             speakerphoneVol;
  465.     short                             speakerphoneMicVol;
  466.     short                             ringerVol;
  467.     short                             otherVol;
  468.     short                             ringerTypes;
  469.     short                             hasDisplay;
  470.     short                             displayRows;
  471.     short                             numDNs;
  472.     short                             maxAllocCA;
  473.     short                             curAllocCA;
  474.     short                             builtinSpeakerVol;
  475.     short                             builtinSpeakerMicVol;
  476.     long                             reserved;
  477. };
  478. typedef struct TELTermRecord TELTermRecord;
  479.  
  480. typedef TELTermRecord *TELTermPtr;
  481. struct TELRecord {
  482.     short                             procID;
  483.  
  484.     TELFlags                         flags;
  485.     short                             reserved;
  486.  
  487.     long                             refCon;
  488.     long                             userData;
  489.  
  490.     UniversalProcPtr                 defproc;
  491.  
  492.     Ptr                             config;
  493.     Ptr                             oldConfig;
  494.  
  495.     TELTermPtr                         pTELTerm;
  496.  
  497.     long                             telPrivate;
  498.     long                             reserved1;
  499.     long                             reserved2;
  500.  
  501.     long                             pTELTermSize;
  502.     short                             version;
  503.  
  504. };
  505. typedef struct TELRecord TELRecord;
  506.  
  507. typedef TELRecord *TELPtr;
  508. typedef TELPtr *TELHandle;
  509. typedef unsigned long TELDNFeatureFlags;
  510.  
  511. enum {
  512.     dndSub                        = 1L << 0,                        /* do not disturb subscribed */
  513.     dndAvail                    = 1L << 1,                        /* do not disturb available */
  514.     dndActive                    = 1L << 2,                        /* do not disturb active */
  515.     voiceMailAccessSub            = 1L << 3,                        /* message waiting subscribed */
  516.     voiceMailAccessAvail        = 1L << 4,                        /* message waiting available */
  517.     voiceMailAccessActive        = 1L << 5,                        /* message waiting active */
  518.     pagingSub                    = 1L << 6,                        /* paging is subscribed */
  519.     pagingAvail                    = 1L << 7,                        /* paging is available */
  520.     pagingActive                = 1L << 8,                        /* paging is active */
  521.     intercomSub                    = 1L << 9,                        /* intercom is subscribed */
  522.     intercomAvail                = 1L << 10,                        /* intercom is available */
  523.     intercomActive                = 1L << 11,                        /* intercom is active */
  524.     dnSelectSub                    = 1L << 12,                        /* DN select is subscribed */
  525.     dnSelectAvail                = 1L << 13,                        /* DN select is available */
  526.     dnSelectActive                = 1L << 14,                        /* DN is selected */
  527.     callPickupSub                = 1L << 15,                        /* call pickup is subscribed */
  528.     callPickupAvail                = 1L << 16,                        /* call pickup is available */
  529.     dnInUse                        = 1L << 17,                        /* a CA is allocated for this DN */
  530.     logicalDN                    = 1L << 18,                        /* this DN is not on this terminal */
  531.     dnAccessible                = 1L << 19,                        /* commands can be sent to this DN */
  532.     canInitiate                    = 1L << 20,                        /* an outgoing CA can be initiated */
  533.     voiceMessageWaiting            = 1L << 21,                        /* voice mail waiting for this dn */
  534.     hasDNSoundStreams            = 1L << 22,                        /* sound streams are supported on this DN */
  535.     autoAnswerAvail                = 1L << 23,                        /* AutoAnswer is set for this DN */
  536.     autoAnswerActive            = 1L << 24,                        /* AutoAnswer is currently applied to CA on this DN */
  537.     tollSaverAvail                = 1L << 25,                        /* tollSaver is set for this DN */
  538.     tollSaverActive                = 1L << 26                        /* tollSaver is currently applied to CA on this DN */
  539. };
  540.  
  541. typedef unsigned long TELDNForwardFlags;
  542.  
  543. enum {
  544.     immediateForwardSub            = 1L << 0,                        /* immediate call forward subscribed */
  545.     immediateForwardAvail        = 1L << 1,                        /* immediate call forward available */
  546.     immediateForwardActive        = 1L << 2,                        /* immediate call forward active */
  547.     busyForwardSub                = 1L << 3,                        /* forward on busy subscribed */
  548.     busyForwardAvail            = 1L << 4,                        /* forward on busy available */
  549.     busyForwardActive            = 1L << 5,                        /* forward on busy active */
  550.     noAnswerForwardSub            = 1L << 6,                        /* no answer call forward subscribed */
  551.     noAnswerForwardAvail        = 1L << 7,                        /* no answer call forward available */
  552.     noAnswerForwardActive        = 1L << 8,                        /* no answer call forward active */
  553.     busyNAForwardSub            = 1L << 9,                        /* busy & no answer call forward subscribed */
  554.     busyNAForwardAvail            = 1L << 10,                        /* busy & no answer call forward available */
  555.     busyNAForwardActive            = 1L << 11                        /* busy & no answer call forward active */
  556. };
  557.  
  558. struct TELDNRecord {
  559.  
  560.     short                             dnRef;
  561.     StringPtr                         dn;
  562.     StringPtr                         dnPartyName;
  563.     StringPtr                         dnSubaddress;
  564.     TELHandle                         hTEL;
  565.     short                             maxAllocCA;
  566.     short                             curAllocCA;
  567.     short                             dnType;
  568.     TELDNFeatureFlags                 featureFlags;
  569.     short                             numPageIDs;
  570.     short                             numIntercomIDs;
  571.     short                             numPickupIDs;
  572.     TELDNForwardFlags                 forwardFlags;
  573.     StringPtr                         iForwardDN;
  574.     StringPtr                         iForwardSubaddress;
  575.     StringPtr                         iForwardPartyName;
  576.     StringPtr                         bForwardDN;
  577.     StringPtr                         bForwardSubaddress;
  578.     StringPtr                         bForwardPartyName;
  579.     StringPtr                         naForwardDN;
  580.     StringPtr                         naForwardSubaddress;
  581.     StringPtr                         naForwardPartyName;
  582.     short                             naForwardRings;
  583.     long                             telDNPrivate;
  584.     long                             refCon;
  585.     long                             userData;
  586.     long                             reserved;
  587. };
  588. typedef struct TELDNRecord TELDNRecord;
  589.  
  590. typedef TELDNRecord *TELDNPtr;
  591. typedef TELDNPtr *TELDNHandle;
  592. typedef unsigned long TELCAFeatureFlags;
  593.  
  594. enum {
  595.     holdSub                        = 1L << 0,                        /* hold subscribed  */
  596.     holdAvail                    = 1L << 1,                        /* hold available  */
  597.     holdActive                    = 1L << 2,                        /* hold active  */
  598.     conferenceSub                = 1L << 3,                        /* conference subscribed */
  599.     conferenceAvail                = 1L << 4,                        /* conference available */
  600.     conferenceActive            = 1L << 5,                        /* conference active  */
  601.     conferenceDropSub            = 1L << 6,                        /* conference drop subscribed  */
  602.     conferenceDropAvail            = 1L << 7,                        /* a call to TELDrop will drop this */
  603.                                                                 /* CA only from a conference */
  604.     conferenceSplitSub            = 1L << 8,                        /* conference split subscribed  */
  605.     conferenceSplitAvail        = 1L << 9,                        /* conference split available for this CA */
  606.     numToConferenceRequired        = 1L << 10,                        /* the number of CAs to be conferenced is */
  607.                                                                 /* required in TELConfPrep  */
  608.     transferSub                    = 1L << 11,                        /* transfer subscribed  */
  609.     transferAvail                = 1L << 12,                        /* transfer available  */
  610.     transferActive                = 1L << 13,                        /* transfer active */
  611.     caRelated                    = 1L << 14                        /* this CA is the specified in some other CA's relatedCA field*/
  612. };
  613.  
  614. typedef unsigned long TELCAOtherFeatures;
  615.  
  616. enum {
  617.     callbackSub                    = 1L << 0,                        /* call back subscribed */
  618.     callbackAvail                = 1L << 1,                        /* call back available */
  619.     callbackActive                = 1L << 2,                        /* call back active  */
  620.     callbackClearSub            = 1L << 3,                        /* call back clearing subscribed */
  621.     callbackNowSub                = 1L << 4,                        /* call back now subscribed */
  622.     callbackNowAvail            = 1L << 5,                        /* call back now available  */
  623.     callbackBusy                = 1L << 6,                        /* call back on busy */
  624.     callbackNoAnswer            = 1L << 7,                        /* call back on no answer */
  625.     callbackReturnsRef            = 1L << 8,                        /* call back returns a reference */
  626.     parkSub                        = 1L << 9,                        /* call park subscribed */
  627.     parkAvail                    = 1L << 10,                        /* call park available */
  628.     parkActive                    = 1L << 11,                        /* call park active */
  629.     parkRetrieveSub                = 1L << 12,                        /* call park retrieve subscribed */
  630.     parkRetrieveWithID            = 1L << 13,                        /* retrieve parked calls with IDs */
  631.     parkWithReturnedID            = 1L << 14,                        /* park call to a specific remote ID */
  632.     parkWithGivenID                = 1L << 18,                        /* for switch that requires ID for parking */
  633.     rejectable                    = 1L << 15,                        /* CA is rejectable  */
  634.     deflectable                    = 1L << 16,                        /* CA is deflectable  */
  635.     acceptable                    = 1L << 17,                        /* CA is acceptable */
  636.     voiceDetected                = 1L << 19,                        /* voice has been detected on this CA incase of */
  637.                                                                 /* an incoming call */
  638.     callAnswdTSRings            = 1L << 20                        /* incoimng call was answered on TollSaver rings */
  639. };
  640.  
  641. typedef struct TELCARecord TELCARecord;
  642. typedef TELCARecord *TELCAPtr;
  643. typedef TELCAPtr *TELCAHandle;
  644. struct TELCARecord {
  645.     short                             caRef;
  646.     TELDNHandle                     hTELDN;
  647.     TELHandle                         hTEL;
  648.     short                             caState;
  649.     TELCAHandle                     relatedCA;
  650.     long                             connectTime;                /* can be used by application to keep track of connect time */
  651.     short                             intExt;
  652.     short                             callType;
  653.     short                             dialType;
  654.     short                             bearerType;
  655.     short                             rate;
  656.     StringPtr                         rmtDN;
  657.     StringPtr                         rmtPartyName;
  658.     StringPtr                         rmtSubaddress;
  659.     StringPtr                         routeDN;
  660.     StringPtr                         routePartyName;
  661.     StringPtr                         routeSubaddress;
  662.     short                             priority;
  663.     short                             conferenceLimit;
  664.     TELCAFeatureFlags                 featureFlags;
  665.     TELCAOtherFeatures                 otherFeatures;
  666.     long                             telCAPrivate;
  667.     long                             refCon;
  668.     long                             userData;
  669.     long                             reserved;
  670. };
  671.  
  672. /* Constants for HandleType in structure above */
  673.  
  674. enum {
  675.     telHandleType                = 0,                            /* feature requires a terminal handle */
  676.     telDNHandleType                = 1,                            /* feature requires a DN handle */
  677.     telCAHandleType                = 2                                /* feature requires a CA handle */
  678. };
  679.  
  680. struct FeatureList {
  681.     short                             featureID;
  682.     StringPtr                         featureName;
  683.     short                             handleType;
  684.     struct FeatureList *            nextFeature;
  685. };
  686. typedef struct FeatureList FeatureList;
  687.  
  688. typedef FeatureList *FeatureListPtr;
  689. /* CA MESSAGE STRUCTURES FOR MSGINFO */
  690. struct CAGenericMsgRec {
  691.     StringPtr                         rmtDN;
  692.     StringPtr                         rmtName;
  693.     StringPtr                         rmtSubaddress;
  694.     short                             dialType;
  695. };
  696. typedef struct CAGenericMsgRec CAGenericMsgRec;
  697.  
  698. struct CAUserUserInfoMsgRec {
  699.     StringPtr                         userUserInfo;
  700. };
  701. typedef struct CAUserUserInfoMsgRec CAUserUserInfoMsgRec;
  702.  
  703. struct CAConfMsgRec {
  704.     TELCAHandle                     relatedCA;
  705. };
  706. typedef struct CAConfMsgRec CAConfMsgRec;
  707.  
  708. struct CATransfMsgRec {
  709.     StringPtr                         rmtDN;
  710.     StringPtr                         rmtName;
  711.     StringPtr                         rmtSubaddress;
  712.     short                             dialType;
  713.     TELCAHandle                     prepCA;
  714. };
  715. typedef struct CATransfMsgRec CATransfMsgRec;
  716.  
  717. typedef pascal void (*TelephoneTermMsgProcPtr)(TELHandle hTEL, long msg, short mtype, short value, long globals);
  718. typedef pascal void (*TelephoneDNMsgProcPtr)(TELDNHandle hTELDN, long Msg, short mtype, short value, ConstStr255Param rmtDN, ConstStr255Param rmtName, ConstStr255Param rmtSubaddress, long globals);
  719. typedef pascal void (*TelephoneCAMsgProcPtr)(TELCAHandle hTELCA, long Msg, short mtype, short value, Ptr Msginfo, long globals);
  720. typedef pascal void (*TelephoneChooseIdleProcPtr)(void );
  721.  
  722. #if GENERATINGCFM
  723. typedef UniversalProcPtr TelephoneTermMsgUPP;
  724. typedef UniversalProcPtr TelephoneDNMsgUPP;
  725. typedef UniversalProcPtr TelephoneCAMsgUPP;
  726. typedef UniversalProcPtr TelephoneChooseIdleUPP;
  727. #else
  728. typedef TelephoneTermMsgProcPtr TelephoneTermMsgUPP;
  729. typedef TelephoneDNMsgProcPtr TelephoneDNMsgUPP;
  730. typedef TelephoneCAMsgProcPtr TelephoneCAMsgUPP;
  731. typedef TelephoneChooseIdleProcPtr TelephoneChooseIdleUPP;
  732. #endif
  733.  
  734. enum {
  735.     uppTelephoneTermMsgProcInfo = kPascalStackBased
  736.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TELHandle)))
  737.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  738.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  739.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  740.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long))),
  741.     uppTelephoneDNMsgProcInfo = kPascalStackBased
  742.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TELDNHandle)))
  743.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  744.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  745.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  746.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(ConstStr255Param*)))
  747.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(ConstStr255Param*)))
  748.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(ConstStr255Param*)))
  749.          | STACK_ROUTINE_PARAMETER(8, SIZE_CODE(sizeof(long))),
  750.     uppTelephoneCAMsgProcInfo = kPascalStackBased
  751.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TELCAHandle)))
  752.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  753.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  754.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  755.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(Ptr)))
  756.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long))),
  757.     uppTelephoneChooseIdleProcInfo = kPascalStackBased
  758. };
  759.  
  760. #if GENERATINGCFM
  761. #define NewTelephoneTermMsgProc(userRoutine)        \
  762.         (TelephoneTermMsgUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneTermMsgProcInfo, GetCurrentArchitecture())
  763. #define NewTelephoneDNMsgProc(userRoutine)        \
  764.         (TelephoneDNMsgUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneDNMsgProcInfo, GetCurrentArchitecture())
  765. #define NewTelephoneCAMsgProc(userRoutine)        \
  766.         (TelephoneCAMsgUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneCAMsgProcInfo, GetCurrentArchitecture())
  767. #define NewTelephoneChooseIdleProc(userRoutine)        \
  768.         (TelephoneChooseIdleUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneChooseIdleProcInfo, GetCurrentArchitecture())
  769. #else
  770. #define NewTelephoneTermMsgProc(userRoutine)        \
  771.         ((TelephoneTermMsgUPP) (userRoutine))
  772. #define NewTelephoneDNMsgProc(userRoutine)        \
  773.         ((TelephoneDNMsgUPP) (userRoutine))
  774. #define NewTelephoneCAMsgProc(userRoutine)        \
  775.         ((TelephoneCAMsgUPP) (userRoutine))
  776. #define NewTelephoneChooseIdleProc(userRoutine)        \
  777.         ((TelephoneChooseIdleUPP) (userRoutine))
  778. #endif
  779.  
  780. #if GENERATINGCFM
  781. #define CallTelephoneTermMsgProc(userRoutine, hTEL, msg, mtype, value, globals)        \
  782.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneTermMsgProcInfo, (hTEL), (msg), (mtype), (value), (globals))
  783. #define CallTelephoneDNMsgProc(userRoutine, hTELDN, Msg, mtype, value, rmtDN, rmtName, rmtSubaddress, globals)        \
  784.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneDNMsgProcInfo, (hTELDN), (Msg), (mtype), (value), (rmtDN), (rmtName), (rmtSubaddress), (globals))
  785. #define CallTelephoneCAMsgProc(userRoutine, hTELCA, Msg, mtype, value, Msginfo, globals)        \
  786.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneCAMsgProcInfo, (hTELCA), (Msg), (mtype), (value), (Msginfo), (globals))
  787. #define CallTelephoneChooseIdleProc(userRoutine)        \
  788.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneChooseIdleProcInfo)
  789. #else
  790. #define CallTelephoneTermMsgProc(userRoutine, hTEL, msg, mtype, value, globals)        \
  791.         (*(userRoutine))((hTEL), (msg), (mtype), (value), (globals))
  792. #define CallTelephoneDNMsgProc(userRoutine, hTELDN, Msg, mtype, value, rmtDN, rmtName, rmtSubaddress, globals)        \
  793.         (*(userRoutine))((hTELDN), (Msg), (mtype), (value), (rmtDN), (rmtName), (rmtSubaddress), (globals))
  794. #define CallTelephoneCAMsgProc(userRoutine, hTELCA, Msg, mtype, value, Msginfo, globals)        \
  795.         (*(userRoutine))((hTELCA), (Msg), (mtype), (value), (Msginfo), (globals))
  796. #define CallTelephoneChooseIdleProc(userRoutine)        \
  797.         (*(userRoutine))()
  798. #endif
  799. extern pascal TELErr InitTEL(void );
  800.  
  801. extern pascal TELErr TELGetInfo(TELHandle hTEL);
  802.  
  803. extern pascal TELErr TELOpenTerm(TELHandle hTEL);
  804.  
  805. extern pascal TELErr TELResetTerm(TELHandle hTEL);
  806.  
  807. extern pascal TELErr TELCloseTerm(TELHandle hTEL);
  808.  
  809. extern pascal TELErr TELTermMsgHand(TELHandle hTEL, long eventMask, TelephoneTermMsgUPP msgProc, long globals);
  810.  
  811. extern pascal TELErr TELClrTermMsgHand(TELHandle hTEL, TelephoneTermMsgUPP msgProc);
  812.  
  813. extern pascal TELErr TELTermEventsSupp(TELHandle hTEL, long *eventMask);
  814.  
  815. extern pascal short TELGetProcID(Str255 name);
  816.  
  817. extern pascal TELHandle TELNew(short procID, TELFlags flags, long refCon, long userData);
  818.  
  819. extern pascal TELHandle TELNewWithResult(short procID, TELFlags flags, long refCon, long userData, TELErr *error);
  820.  
  821. extern pascal TELErr TELDefault(Ptr *theConfig, short procID, Boolean allocate);
  822.  
  823. extern pascal Boolean TELValidate(TELHandle hTEL);
  824.  
  825. extern pascal Ptr TELGetConfig(TELHandle hTEL);
  826.  
  827. extern pascal short TELSetConfig(TELHandle hTEL, Ptr thePtr);
  828.  
  829. extern pascal TELErr TELChoose(TELHandle *hTEL, Point where, TelephoneChooseIdleProcPtr idleProc);
  830.  
  831. extern pascal Handle TELSetupPreflight(short procID, long *magicCookie);
  832.  
  833. extern pascal void TELSetupSetup(short procID, Ptr theConfig, short count, DialogPtr theDialog, long *magicCookie);
  834.  
  835. extern pascal Boolean TELSetupFilter(short procID, Ptr theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie);
  836.  
  837. extern pascal void TELSetupItem(short procID, Ptr theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie);
  838.  
  839. extern pascal void TELSetupCleanup(short procID, Ptr theConfig, short count, DialogPtr theDialog, long *magicCookie);
  840.  
  841. extern pascal void TELSetupXCleanup(short procID, Ptr theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie);
  842.  
  843. extern pascal void TELSetupPostflight(short procID);
  844.  
  845. extern pascal TELErr TELDispose(TELHandle hTEL);
  846.  
  847. extern pascal short TELCountDNs(TELHandle hTEL, short dnType, Boolean physical);
  848.  
  849. extern pascal TELErr TELDNLookupByIndex(TELHandle hTEL, short dnType, Boolean physical, short index, TELDNHandle *hTELDN);
  850.  
  851. extern pascal TELErr TELDNLookupByName(TELHandle hTEL, ConstStr255Param DN, TELDNHandle *hTELDN);
  852.  
  853. extern pascal TELErr TELDNSelect(TELDNHandle hTELDN, Boolean select);
  854.  
  855. extern pascal TELErr TELDNDispose(TELDNHandle hTELDN);
  856.  
  857. extern pascal TELErr TELGetDNInfo(TELDNHandle hTELDN);
  858.  
  859. extern pascal TELErr TELGetDNFlags(TELDNHandle hTELDN, long *dnFeatureFlags, long *dnForwardFlags);
  860.  
  861. extern pascal TELErr TELDNMsgHand(TELDNHandle hTELDN, Boolean allDNs, long eventMask, TelephoneDNMsgProcPtr msgProc, long globals);
  862.  
  863. extern pascal TELErr TELClrDNMsgHand(TELDNHandle hTELDN, TelephoneDNMsgProcPtr msgProc);
  864.  
  865. extern pascal TELErr TELDNEventsSupp(TELDNHandle hTELDN, long *eventMask);
  866.  
  867. extern pascal short TELCountCAs(TELDNHandle hTELDN, short internalExternal);
  868.  
  869. extern pascal TELErr TELCALookup(TELDNHandle hTELDN, short internalExternal, short index, TELCAHandle *hTELCA);
  870.  
  871. extern pascal TELErr TELCADispose(TELCAHandle hTELCA);
  872.  
  873. extern pascal TELErr TELGetCAState(TELCAHandle hTELCA, short *state);
  874.  
  875. extern pascal TELErr TELGetCAFlags(TELCAHandle hTELCA, long *caFeatureFlags, long *caOtherFeatures);
  876.  
  877. extern pascal TELErr TELGetCAInfo(TELCAHandle hTELCA);
  878.  
  879. extern pascal TELErr TELCAMsgHand(TELDNHandle hTELDN, long eventMask, TelephoneCAMsgProcPtr msgProc, long globals);
  880.  
  881. extern pascal TELErr TELClrCAMsgHand(TELDNHandle hTELDN, TelephoneCAMsgProcPtr msgProc);
  882.  
  883. extern pascal TELErr TELCAEventsSupp(TELDNHandle hTELDN, long *eventMask);
  884.  
  885. extern pascal TELErr TELSetupCall(TELDNHandle hTELDN, TELCAHandle *hTELCA, ConstStr255Param destDN, ConstStr255Param destName, ConstStr255Param destSubaddress, ConstStr255Param userUserInfo, short bearerType, short rate);
  886.  
  887. extern pascal TELErr TELConnect(TELCAHandle hTELCA);
  888.  
  889. extern pascal TELErr TELDialDigits(TELCAHandle hTELCA, ConstStr255Param digits);
  890.  
  891. extern pascal TELErr TELAcceptCall(TELCAHandle hTELCA);
  892.  
  893. extern pascal TELErr TELRejectCall(TELCAHandle hTELCA, short reason);
  894.  
  895. extern pascal TELErr TELDeflectCall(TELCAHandle hTELCA, ConstStr255Param rmtDN, ConstStr255Param rmtName, ConstStr255Param rmtSubaddress);
  896.  
  897. extern pascal TELErr TELAnswerCall(TELCAHandle hTELCA);
  898.  
  899. extern pascal TELErr TELDrop(TELCAHandle hTELCA, ConstStr255Param userUserInfo);
  900.  
  901. extern pascal TELErr TELHold(TELCAHandle hTELCA);
  902.  
  903. extern pascal TELErr TELRetrieve(TELCAHandle hTELCA);
  904.  
  905. extern pascal TELErr TELConferencePrep(TELCAHandle hTELCA1, TELCAHandle hTELCA2, short numToConference);
  906.  
  907. extern pascal TELErr TELConferenceEstablish(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
  908.  
  909. extern pascal TELErr TELConferenceSplit(TELCAHandle hTELCA);
  910.  
  911. extern pascal TELErr TELTransferPrep(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
  912.  
  913. extern pascal TELErr TELTransferEstablish(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
  914.  
  915. extern pascal TELErr TELTransferBlind(TELCAHandle hTELCA, ConstStr255Param rmtDN, ConstStr255Param rmtName, ConstStr255Param rmtSubaddress);
  916.  
  917. extern pascal TELErr TELForwardSet(TELDNHandle hTELDN, ConstStr255Param forwardDN, ConstStr255Param forwardName, ConstStr255Param forwardSubaddress, short forwardType, short numrings);
  918.  
  919. extern pascal TELErr TELForwardClear(TELDNHandle hTELDN, short forwardType);
  920.  
  921. extern pascal TELErr TELCallbackSet(TELCAHandle hTELCA, short *callbackRef);
  922.  
  923. extern pascal TELErr TELCallbackClear(TELHandle hTEL, short callbackRef);
  924.  
  925. extern pascal TELErr TELCallbackNow(TELCAHandle hTELCA, short callbackRef);
  926.  
  927. extern pascal TELErr TELDNDSet(TELDNHandle hTELDN, short dndType);
  928.  
  929. extern pascal TELErr TELDNDClear(TELDNHandle hTELDN, short dndType);
  930.  
  931. extern pascal TELErr TELCallPickup(TELCAHandle hTELCA, ConstStr255Param pickupDN, short pickupGroupID);
  932.  
  933. extern pascal TELErr TELParkCall(TELCAHandle hTELCA, StringPtr *parkRetrieveID, ConstStr255Param parkID);
  934.  
  935. extern pascal TELErr TELRetrieveParkedCall(TELCAHandle hTELCA, ConstStr255Param parkRetrieveID);
  936.  
  937. extern pascal TELErr TELVoiceMailAccess(TELCAHandle hTELCA);
  938.  
  939. extern pascal TELErr TELPaging(TELCAHandle hTELCA, short pageID);
  940.  
  941. extern pascal TELErr TELIntercom(TELCAHandle hTELCA, short intercomID);
  942.  
  943. extern pascal TELErr TELOtherFeatureList(TELHandle hTEL, FeatureListPtr *fList);
  944.  
  945. extern pascal TELErr TELOtherFeatureImplement(TELHandle hTEL, Handle theHandle, short featureID);
  946.  
  947. extern pascal TELErr TELToolFunctions(TELHandle hTEL, short msgcode, Boolean *supportsIt);
  948.  
  949. extern pascal TELErr TELOtherFunction(TELHandle hTEL, Ptr paramblock, long size);
  950.  
  951. extern pascal TELErr TELGetHooksw(TELHandle hTEL, short hookType, Boolean *offHook);
  952.  
  953. extern pascal TELErr TELSetHooksw(TELHandle hTEL, short hookType, Boolean offHook);
  954.  
  955. extern pascal TELErr TELGetVolume(TELHandle hTEL, short volType, short *level, short *volState);
  956.  
  957. extern pascal TELErr TELSetVolume(TELHandle hTEL, short volType, short *level, short volState);
  958.  
  959. extern pascal TELErr TELAlert(TELHandle hTEL, short *level, short alertPattern);
  960.  
  961. extern pascal TELErr TELGetDisplay(TELHandle hTEL, short index, short *displayMode, StringPtr *text);
  962.  
  963. extern pascal TELErr TELSetDisplay(TELHandle hTEL, short index, short displayMode, ConstStr255Param text);
  964.  
  965. extern pascal void TELIdle(TELHandle hTEL);
  966.  
  967. extern pascal void TELActivate(TELHandle hTEL, Boolean activate);
  968.  
  969. extern pascal void TELResume(TELHandle hTEL, Boolean resume);
  970.  
  971. extern pascal Boolean TELMenu(TELHandle hTEL, short menuID, short item);
  972.  
  973. extern pascal void TELEvent(TELHandle hTEL, const EventRecord *theEvent);
  974.  
  975. extern pascal void TELGetToolName(short procID, Str255 name);
  976.  
  977. extern pascal Handle TELGetVersion(TELHandle hTEL);
  978.  
  979. extern pascal short TELGetTELVersion(void );
  980.  
  981. extern pascal TELErr TELIntlToEnglish(TELHandle hTEL, Ptr inputPtr, Ptr *outputPtr, short language);
  982.  
  983. extern pascal TELErr TELEnglishToIntl(TELHandle hTEL, Ptr inputPtr, Ptr *outputPtr, short language);
  984.  
  985. extern pascal TELErr TELGetDNSoundInput(TELDNHandle hTELDN, Str255 deviceName);
  986.  
  987. extern pascal TELErr TELDisposeDNSoundInput(TELDNHandle hTELDN, ConstStr255Param deviceName);
  988.  
  989. extern pascal TELErr TELGetDNSoundOutput(TELDNHandle hTELDN, Component *SndOut);
  990.  
  991. extern pascal TELErr TELDisposeDNSoundOutput(TELDNHandle hTELDN, Component SndOut);
  992.  
  993. extern pascal TELErr TELGetHSSoundInput(TELHandle termHand, Str255 deviceName);
  994.  
  995. extern pascal TELErr TELDisposeHSSoundInput(TELHandle termHand, ConstStr255Param deviceName);
  996.  
  997. extern pascal TELErr TELGetHSSoundOutput(TELHandle termHand, Component *SndOut);
  998.  
  999. extern pascal TELErr TELDisposeHSSoundOutput(TELHandle termHand, Component SndOut);
  1000.  
  1001. extern pascal TELErr TELDNSetAutoAnswer(TELDNHandle hTELDN, Boolean AutoAnswerOn);
  1002.  
  1003. extern pascal TELErr TELDNTollSaverControl(TELDNHandle hTELDN, Boolean QuickAnswer);
  1004.  
  1005. extern pascal TELErr TELSetIndHSConnect(TELHandle termHand, Boolean Connect);
  1006.  
  1007. extern pascal TELErr TELGetIndHSConnect(TELHandle termHand, Boolean *Connect);
  1008.  
  1009. extern pascal TELErr TELCAVoiceDetect(TELCAHandle hTELCA, Boolean VoiceDetectOn);
  1010.  
  1011. extern pascal TELErr TELCASilenceDetect(TELCAHandle hTELCA, Boolean DetectOn, long Period);
  1012.  
  1013. extern pascal TELErr TELGetTelNewErr(void );
  1014.  
  1015. extern pascal TELErr TELDNSetDTMF(TELDNHandle hTELDN, Boolean dtmfOn);
  1016.  
  1017. extern pascal TELErr TELDNGetDTMF(TELDNHandle hTELDN, Boolean *dtmfOn);
  1018.  
  1019. extern pascal TELErr TELHSSetDTMF(TELHandle termHand, Boolean dtmfOn);
  1020.  
  1021. extern pascal TELErr TELHSGetDTMF(TELHandle termHand, Boolean *dtmfOn);
  1022.  
  1023. extern pascal TELErr TELGetDNStatus(TELDNHandle hTELDN, long *inUse);
  1024.  
  1025. extern pascal TELErr TELGetDNProgressDet(TELDNHandle hTELDN, long selector, Boolean *prgDetOn);
  1026.  
  1027. extern pascal TELErr TELSetDNProgressDet(TELDNHandle hTELDN, long selector, Boolean prgDetOn);
  1028.  
  1029. #endif
  1030.  
  1031. #if PRAGMA_ALIGN_SUPPORTED
  1032. #pragma options align=reset
  1033. #endif
  1034.  
  1035. #if PRAGMA_IMPORT_SUPPORTED
  1036. #pragma import off
  1037. #endif
  1038.  
  1039. #ifdef __cplusplus
  1040. }
  1041. #endif
  1042.  
  1043. #endif /* __TELEPHONES__ */
  1044.  
  1045.